
'-------------------------------------------
' Кнопка главного меню
'-------------------------------------------

{trigger:kn_navigator_menu}
	(L.L.elec_busbar_main) 
	{if}
		(T.L.ev_IBIS_piep)
	{endif}
	
	(L.L.navigator_menu) !
	{if}
		1 (S.L.navigator_menu) s1		
		0 (S.L.informator_menu) (S.L.autoinform_menu) (S.L.salon_menu) (S.L.menu_select)		
	{else}
		0 (S.L.navigator_menu) s1
	{endif}
{end}


'-------------------------------------------
' Кнопка меню автоинформатора
'-------------------------------------------

{trigger:kn_autoinform_menu}
	(L.L.elec_busbar_main) 
	{if}
		(T.L.ev_IBIS_piep)
	{endif}

	(L.L.elec_busbar_main) 
	{if}	
	(L.L.autoinform_menu) !
	{if}
		1 (S.L.autoinform_menu) s1
		1 (S.L.menu_select)		
		0 (S.L.navigator_menu) (S.L.informator_menu) (S.L.salon_menu)
	{else}
		0 (S.L.autoinform_menu) s1
		0 (S.L.menu_select)			
	{endif}
	{endif}	
{end}


'-------------------------------------------
' Кнопка меню информатора
'-------------------------------------------

{trigger:kn_informator_menu}
	(L.L.elec_busbar_main) 
	{if}
		(T.L.ev_IBIS_piep)
	{endif}

	(L.L.elec_busbar_main) 
	{if}	
	(L.L.informator_menu) !
	{if}
		1 (S.L.informator_menu) s1
		1 (S.L.menu_select)				
		0 (S.L.navigator_menu) (S.L.autoinform_menu) (S.L.salon_menu)		
	{else}
		0 (S.L.informator_menu) s1
		0 (S.L.menu_select)			
	{endif}
	{endif}	
{end}


'-------------------------------------------
' Кнопка меню салона
'-------------------------------------------

{trigger:kn_salon_menu}
	(L.L.elec_busbar_main) 
	{if}
		(T.L.ev_IBIS_piep)
	{endif}

	(L.L.elec_busbar_main) 
	{if}	
	(L.L.salon_menu) !
	{if}
		1 (S.L.salon_menu) s1
		1 (S.L.menu_select)			
		0 (S.L.navigator_menu) (S.L.autoinform_menu) (S.L.informator_menu) (S.L.salon_menu1_visible) 		
	{else}
		0 (S.L.salon_menu) s1
		0 (S.L.menu_select)			
	{endif}
	{endif}	
{end}


'-------------------------------------------
' Кнопка меню вверх
'-------------------------------------------

{trigger:kn_down_menu}
	(L.L.elec_busbar_main) 
	{if}
		(T.L.ev_IBIS_piep)
	{endif}
	
	(L.L.menu_select) 	
	(L.L.menu_select_vis) 2 < &&
	{if}
		(L.L.menu_select_vis) 1 + (S.L.menu_select_vis)
	{endif}
{end}


'-------------------------------------------
' Кнопка меню вверх
'-------------------------------------------

{trigger:kn_up_menu}
	(L.L.elec_busbar_main) 
	{if}
		(T.L.ev_IBIS_piep)
	{endif}

	(L.L.menu_select) 	
	(L.L.menu_select_vis) 0 > &&
	{if}
		(L.L.menu_select_vis) 1 - (S.L.menu_select_vis)
	{endif}
{end}


{macro:informator_init}
	0 (S.L.informator_menu) (S.L.autoinform_menu) (S.L.salon_menu) (S.L.menu_select)
	
	1 (S.L.navigator_menu) 
	
{end}

'----------------------------------------
' МАКРОСЫ
'----------------------------------------

{macro:informator_frame}

	(M.L.navigator_mode)

{end}

'----------------------------------------
' Режимы работы информатора ОБЫЧНЫЙ
'----------------------------------------

{macro:informator_frame}

	(M.L.navigator_mode)

{end}
	
	
{macro:navigator_mode}

	(L.L.navigator_menu)	
	{if}		

		"Климат                          "  "@" $+			
		" - в салоне, С: "  $+ (L.$.cockpit_temperatur) 35 $SetLengthL $+ 			
		"@" $+		
		" - на улице, С:  "  $+ (L.$.Temp_out) 35 $SetLengthL $+			
		"@" $+			
		" " $+ "@" $+			
		"Суточный пробег, км : "  $+ (L.$.odometr_disp_sutki) 35 $SetLengthL $+		
		"@" $+
		" " $+ "@" $+		
		"Топливо, л:  "  $+ (L.$.cockpit_tankuhr) 25 $SetLengthL $+				
		"@" $+
		" " $+ "@" $+		
		
		" " $+ "@" $+
		" " $+ "@" $+			
		
		{endif}		
			
		(S.$.navigator_menu)
	{endif}



	(L.L.autoinform_menu)
	{if}

		
		">" (L.$.IBIS_busstop_name) 25 $SetLengthL $+ "@" $+
		" " $+ (L.$.IBIS_busstop_name_next) 25 $SetLengthL $+ "@" $+
		"=============================" $+ "@" $+
		
		(L.L.schedule_active)
		{if}

					"ОТСТАВАНИЕ: " $+
				{else}
					"ОПЕРЕЖЕНИЕ: " $+
				{endif}
			{else}
				" " $+
			{endif}
			l0 abs trunc " 2" $IntToStrEnh $+  
			"." $+ 
			l0 abs l0 abs trunc - 10 * " 1"  $IntToStrEnh $+ 
			" мин." $+
		{else}
			" " $+
		{endif}
		
		(S.$.autoinform_menu)
	{endif}


	
	
	(L.L.informator_menu)	
	{if}		
		1 (S.L.navigator_menu_visible)
	
		"Информатор" "@" $+
		" " $+ "@" $+
		" " $+ "@" $+
		
		(L.L.menu_select_vis) 0 =
		{if}
			"> " $+
		{else}
			"  " $+
		{endif}
		"Маршрут    " $+ (L.$.Matrix_Nr) 13 $SetLengthL $+		
		
		 "@" $+	
		" " $+ "@" $+		 
		
		(L.L.menu_select_vis) 1 =
		{if}
			"> " $+
		{else}
			"  " $+
		{endif}
		"Реис    " $+ (L.L.IBIS_TerminusCode) "03" $IntToStrEnh $+	
		{endif}		
		
		(S.$.informator_menu)
	{else}
		0 (S.L.navigator_menu_visible)	
	{endif}	

	
	(L.L.informator_menu)
	(L.L.navigator_select_visible) &&	
	{if}
		0 (S.L.navigator_menu_visible)		
		
		(L.L.menu_select_vis) 0 =
		{if}	
		"Введите маршрут:" "@" $+
			{else}
			(L.L.menu_select_vis) 1 =
			{if}
				"Введите рейс:" "@" $+
			{else}
				"Введите код рейса:" "@" $+				
			{endif}
		{endif}
		
		(L.L.IBIS_input) 0 <=
		{if}			
			(L.L.IBIS_BlinkOn)
			{if}
				(L.L.menu_select_vis) 0 =
				{if}	
					(L.$.IBIS_Complex_Line) $+
				{else}
					(L.L.menu_select_vis) 1 =
					{if}
						(L.L.IBIS_TerminusCode) "03" $IntToStrEnh $+

					{endif}
				{endif}
			{else}
				" " $+
			{endif}
		{else}
			(L.L.IBIS_input) $IntToStr $+
		{endif}
		
		"@" $+
		
		(L.L.IBIS_mode) 4 =
		(L.L.menu_select_vis) 2 = &&
		{if}
			(L.L.IBIS_BlinkOn)
			{if}
				"Код рейса неверен" $+
			{else}
				"" $+
			{endif}	
		{else}
			(L.L.IBIS_mode) 6 =
			(L.L.menu_select_vis) 2 = &&
			{if}
				(L.L.IBIS_BlinkOn)
				{if}
					"Код конечной неверен" $+
				{else}
					"" $+
				{endif}
			{else}
				(L.L.menu_select_vis) 0 =
				{if}
					(L.$.IBIS_terminus_name) 23 $SetLength $+
				{else}
					" " $+
				{endif}
			{endif}
		{endif}			
		

		(S.$.navigator_enter1)
		
	{else}
		0 (S.L.navigator_select_visible)
	{endif}

	
	(L.L.salon_menu)	
	{if}		
		1 (S.L.salon_menu_visible)
		
		"САЛОН" "@" $+
		" " $+ "@" $+
		" " $+ "@" $+
		" " $+ "@" $+		

		(L.L.menu_select_vis) 0 =
		{if}
			"> " $+
		{else}
			"  " $+
		{endif}		
		"Связь с салоном                         "  $+ "@" $+			
			
		 "@" $+	
		" " $+ "@" $+		 
		
		(L.L.menu_select_vis) 1 =
		{if}
			"> " $+
		{else}
			"  " $+
		{endif}
		"Видеоустройства                                    " $+ "@" $+ 		
			
		(S.$.salon_menu)
		
	{else}
		0 (S.L.salon_menu_visible)		
	{endif}	

	(L.L.salon_menu)	
	(L.L.salon_menu1_visible) &&		
	{if}		
		0 (S.L.salon_menu_visible) 
		
		"САЛОН" "@" $+
		" " $+ "@" $+
		" " $+ "@" $+
		" " $+ "@" $+
		" " $+ "@" $+
		" " $+ "@" $+
		" " $+ "@" $+		

		"Не обнаружено        " $+ "@" $+ 		
			
		(S.$.salon_menu1)
		
	{else}
		0 (S.L.salon_menu1_visible)		
	{endif}		
	
{end}

